// const screenResume = (name:string,age:number,bust:number)=>{
//     age<24 && bust>=90 && console.log(name+'进入面试');
//     age>=24 || bust<90 && console.log(name+'已被淘汰');
// }

// screenResume('夏红',18,90);
// screenResume('小青',15,38);

// const getResume = (name:string,age:number,bust:number)=>{
//     console.log('年龄:'+age);
//     console.log('胸围:'+bust);
// }

// getResume('夏红',18,90);
// getResume('小青',15,38);

//接口的方式
//加?的为可选值
//[propname:string] :any;  被此接口限制的对象可以添加任意属性
//接口还能限制类,用法和Java的接口类似 class 对象名 implements 接口名 {}
//接口间能继承 interface Teacher extends Girl{}

interface Girl{
    name:string;
    age:number;
    bust:number;
    waistline ?: number;
    [propname:string] :any;
    say():string;
}

const girl:Girl = {name:'夏红',age:17,bust:99,waistline:34,say:()=>{return '欢迎光临'}};
const girl2:Girl = {name:'小青',age:23,bust:56,sex:'男',say(){return '你好啊!'}};


const screenResume = (girl:Girl)=>{
    girl.age<24 && girl.bust>=90 && console.log(girl.name+'进入面试');
    girl.age>=24 || girl.bust<90 && console.log(girl.name+'已被淘汰');
    girl.sex && console.log(girl.name+'的性别是:'+girl.sex);
    
}

screenResume(girl);
screenResume(girl2);

const getResume = (girl:Girl)=>{
    console.log('年龄:'+girl.age);
    console.log('胸围:'+girl.bust);
    console.log(girl.say());
}

getResume(girl);
getResume(girl2);
